Micron Document
🎖️GitЯра🎖️


Displaying Raw • View renderedDownload

core/ui/README.md f07624be882e679affc02931dc75e8cb1594de18 (f07624be) Text, 2.83 KB

Tc9d1d9# `:core:ui`

Tc9d1d9## Overview
The Ta5d6ff`:core:ui` module contains shared Jetpack Compose components, themes, and utility functions used across the entire Meshtastic Android application. It ensures a consistent look and feel following Material 3 guidelines.

Tc9d1d9## Key Components

Tc9d1d9### 1. Alert Dialogs (`org.meshtastic.core.ui.component.AlertDialogs.kt`)
Tff7b72- **`MeshtasticDialog`**: The base dialog component for all alerts.
Tff7b72- **`MeshtasticResourceDialog`**: Optimized for dialogs with resource-only content.
Tff7b72- **`MeshtasticTextDialog`**: Optimized for dialogs with mixed resource and raw text content.

Tc9d1d9### 2. Common UI Elements
Tff7b72- **`LastHeardInfo`**: Displays when a node was last seen.
Tff7b72- **`TelemetryInfo`**: Displays battery, voltage, and other telemetry data.
Tff7b72- **`TransportIcon`**: Shows the connection type (BLE, USB, TCP).
Tff7b72- **`MainAppBar`**: The standard top app bar used in the app.

Tc9d1d9### 3. Preferences
Standardized Material 3 preference components for settings screens:
Tff7b72- Ta5d6ff`RegularPreference`
Tff7b72- Ta5d6ff`SwitchPreference`
Tff7b72- Ta5d6ff`DropDownPreference`
Tff7b72- Ta5d6ff`SliderPreference`
Tff7b72- Ta5d6ff`EditTextPreference`

Tc9d1d9### 4. Utilities
Tff7b72- **`ModifierExtensions.kt`**: Useful Compose Modifiers (e.g., conditional modifiers).
Tff7b72- **`ProtoExtensions.kt`**: Extensions for mapping Protobuf models to UI-friendly strings or icons.

Tc9d1d9## Usage
Most components are designed to be used with the **Compose Multiplatform Resource** library for strings.

Ta5d6ff```Ta5d6ffkotlin
Tff7b72import T7ee787org.meshtastic.core.ui.component.MeshtasticResourceDialog
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.ok

Te6edf3MeshtasticResourceDialogTb4b4b4(
Te6edf3title Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3your_titleTb4b4b4,
Te6edf3message Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3your_messageTb4b4b4,
Te6edf3onDismissRequest Tff7b72= Tb4b4b4{ T8b949e/* ... */ Tb4b4b4}Tb4b4b4,
Te6edf3confirmButtonText Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3ok
Tb4b4b4)
Ta5d6ff```

Tc9d1d9## Module dependency graph

<!--region graph-->
Ta5d6ff```Ta5d6ffmermaid
Ta5d6ffgraph TB
:core:ui[ui]:::kmp-library-compose

classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;

Ta5d6ff```
<!--endregion-->

Served by rngit 1.5.2 - Generated in 0.06s